package com.flxz.Controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.flxz.dto.ParseResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.flxz.service.SAALLMService;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/user/Springai")
public class SAALLMController {
    @Autowired
    private SAALLMService SAA;

    @GetMapping("/parse-transaction")
    public Map<String, Object> parseTransaction(@RequestParam(name="meg")String meg) throws JsonProcessingException {
        ParseResponse result = SAA.getResult(meg);
        Map<String, Object> response = new HashMap<>();
        response.put("code", 200);
        response.put("msg", "success");
        response.put("data", result);
        return response;
    }
}
